package com.zzzyh.forumsystemclient.common;

/**
 * @author 郑雨杭
 * @create 2025/5/27 - 15:26
 * 定义业务码
 */
public enum ResultCode {
    SUCCESS(0, "操作成功"),
    FAILED(1000, "操作失败"),

    FAILED_UNAUTHORIZED(1001, "未授权"),
    FAILED_PARAM_ERROR(1002, "参数校验失败"),

    FAILED_USER_EXIST(1101, "用户已存在"),
    FAILED_USER_NOT_EXIST(1102, "用户不存在"),
    FAILED_USER_LOGIN_ERROR(1103, "用户名或密码错误"),
    FAILED_USER_NOT_LOGIN(1104, "用户未登录"),
    FAILED_USER_BANNED(1105, "用户被封禁"),
    FAILED_USER_FORBIDDEN_SPECT(1106, "用户被禁言"),
    FAILED_USER_ADD_ERROR(1107,"用户新增失败"),
    SUCCESS_USER_CREATE(0, "用户注册成功"),
    FAILED_DB_ERROR(1201, "数据库操作错误"),
    FAILED_JWT_ERROR(1301, "JWT错误"),
    ;
    int code;
    String message;
    ResultCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return "code=" + code +
                ", message='" + message ;
    }
}
